Fix adapt crash for mixed-element 2D meshes with frozen quad layers#524
Conversation
…rs; added a check to the maQuality routine that allows adaptation of tris in mixed element 2d meshes
|
Thank you for the fix @como2099. The changes in the pr adds a check by computing the validity (using positive area) of a quadrilateral element. In line 586, it assumes a 2d mesh in (x,y) coordinate system, which can work fine by itself if the mesh is 2D however until we might get to putting something similar to |
|
Updated the quad validity check to be fully orientation-independent:
This ensures consistent orientation without assuming a specific coordinate system. |
ma/maQuality.cc
Outdated
| Vector d2 = apf::cross(p[2] - p[0], p[3] - p[0]); | ||
|
|
||
| // If both triangles have positive area in same direction, quad is OK | ||
| return (d1[2] > 0 && d2[2] > 0) || (d1[2] < 0 && d2[2] < 0); |
There was a problem hiding this comment.
check for +ve magnitude and direction
|
/runtests |
|
Build Log |
This PR fixes a crash in PUMI adapt that occurs for 2D mixed-element meshes (tri + quad) when quad layers are frozen.
The issue was discovered while using PUMI with CFD workflow. In this configuration, adaptation should proceed on triangle elements even when quad layers are excluded.
The fix adds a guard in maQuality.cc to allow safe adaptation of triangles
in mixed-element 2D meshes without affecting existing workflows.
Bug originally found in release v4.1.0; tested by building against current develop and running the affected
adaptation path.
Fixes #523